/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc.config;

import feign.Logger;
import feign.auth.BasicAuthRequestInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <p>Project: SpringColud - FeignConfig</p>
 * <p>Powered by yzc On 2023-12-29 14:43:41</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@Configuration
public class FeignConfig {

    /**
     * 日志级别
     * @return
     */

    @Bean
    Logger.Level loggerLevel(){
        return Logger.Level.FULL;
    }

    /**
     * 请求拦截 撤回请求头 传递账号信息 格式: Basci xxxxx（username：password Base64加密）
     * @return
     */


   public BasicAuthRequestInterceptor basicAuthRequestInterceptor(){
       return new BasicAuthRequestInterceptor("admin","123456");
   }

   @Bean
  public TokenAuthRequestInterceptor tokenAuthRequestInterceptor(){
       return new TokenAuthRequestInterceptor("dasfpifao.ppiowqjf.safjowq");
   }
}
